package Date.TimeDay08;

import java.time.DayOfWeek;
import java.time.Instant;
import java.time.LocalDate;
import java.time.MonthDay;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoField;

/**
 * 	带有时区时间
 * @author Administrator
 *
 */
public class ZonedDateTimeDemo {

	public static void main(String[] args) {
		// 时区的获取
		ZoneId zone = ZoneId.of("Africa/Harare");
		ZonedDateTime zonedDateTime = ZonedDateTime.now(zone);
		System.out.println(zonedDateTime);
		
		// 由Instant转化
		Instant instant = Instant.now();
		ZonedDateTime zonedDateTime2 = instant.atZone(zone);
		System.out.println(zonedDateTime2);
		
		// 星期
		DayOfWeek dayOfWeek = LocalDate.now().getDayOfWeek();
		System.out.println(dayOfWeek.getValue());
		
		// 范围值
		MonthDay monthDay = MonthDay.now();
		monthDay.range(ChronoField.DAY_OF_MONTH); // filed
		System.out.println(monthDay.range(ChronoField.DAY_OF_MONTH).getMaximum());
	}
	
	
	
	
	
	
	
	
}
